{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'I love Tiananmen in Beijing.'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import requests\n",
    "\n",
    "#\n",
    "# curl -X POST -H \"Content-Type: application/json\" -d \"{\\\"input\\\": {\\\"language\\\": \\\"英语\\\",\\\"content\\\":\\\"我爱北京天安门\\\"}}\" http://192.168.10.14:60002/translate/invoke\n",
    "\n",
    "response = requests.post(\n",
    "    \"http://192.168.10.11:60027/translate/invoke\",\n",
    "    json={'input': {'language': '英语','content':'我爱北京天安门'}}\n",
    ")\n",
    "rep = response.json()\n",
    "rep[\"output\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "curl -X POST -H \"Content-Type: application/json\" -d \"{'input': {'language': '英语','content':'我爱北京天安门'}}\" http://192.168.10.14:60002/translate/invoke\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python310",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
